var n = require("../../utils/util1.js"), t = null;

Page({
    data: {
        content: "内容获取中...",
        adInfo : null,
    },
    GetCon: function(n) {
        this.data.content = n.detail.value, console.log(n.detail.value);
    },
    CopySubmit: function() {
        wx.setClipboardData({
            data: this.data.content,
            success: function() {
                wx.showToast({
                    title: "复制成功",
                    duration: 1e3
                }), wx.getClipboardData({
                    success: function(n) {}
                });
            }
        });
    },
    OpenDream: function() {
        wx.navigateToMiniProgram({
            appId: "wx1d15304c3e4a7593",
            path: "pages/surgery/index/index",
            extraData: {
                foo: "bar"
            },
            envVersion: "develop",
            success: function(n) {}
        });
    },
    GetApi: function() {
        var t = this;
        n._get().then(function(n) {
            var a = n.nuannan, e = Math.floor(Math.random() * a.length);
            console.log(a[e]), t.setData({
                content: a[e]
            });
        }).catch(function(n) {});
    },
    ReplaceSubmit: function() {
        this.GetApi();
    },
    onLoad: function(n) {
        let cacheAdInfo = wx.getStorageSync('adInfo');  
        this.setData({
            adInfo: cacheAdInfo
        })
        this.GetApi(), wx.createInterstitialAd && (n = wx.createInterstitialAd({
            adUnitId: cacheAdInfo.interstitialid
        }));
    },
    onShow: function() {
        t && t.show().catch(function(n) {
            console.error(n);
        });
    },
    onShareAppMessage: function() {
        return {
            title: "可以把妹子撩脸红的珍藏句子",
            path: "pages/nuannan/nuannan?isshare=1",
            success: function(n) {},
            fail: function(n) {}
        };
    },
    onShareTimeline: function() {
        return {
            title: "可以把妹子撩脸红的珍藏句子",
            path: "pages/nuannan/nuannan?isshare=1",
            success: function(n) {},
            fail: function(n) {}
        };
    }
});